package com.atguigu.gulimall.order.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description
 * @Author lhj
 * @Date 2024/4/27 22:07
 */
@Configuration
public class OrderRedisConfig {
    
    @Bean(destroyMethod = "shutdown")
    public RedissonClient redissonClient() {
        //redis://单节点 rediss: //代表安全连接
        Config config = new Config();
        //192.168.56.10 
        config.useSingleServer().setAddress("redis://192.168.56.10:6379");
        return Redisson.create(config);
    }
    
}

